// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "PawnState/Q3D_CPPI_PawnState.h"
#include "Property/Q3D_CPPI_PropertyState.h"
#include "Q3D_CPPA_Pawn.generated.h"

class UQ3D_CPPC_PawnState;
class UQ3D_CPPC_PropertyState;

/**
 *
 */
UCLASS(Blueprintable, ClassGroup = (Q3D), meta = (Tooltip = "Q3D_Pawn 基类(C++)，在 APawn 上添加了 PawnState 和 PropertyState"))
class Q3D_LIB_API AQ3D_CPPA_Pawn : public APawn, public IQ3D_CPPI_PawnState, public IQ3D_CPPI_PropertyState
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	AQ3D_CPPA_Pawn();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent *PlayerInputComponent) override;

	virtual void PossessedBy(AController *NewController) override;

	virtual void UnPossessed() override;

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Q3D_Pawn, meta = (Tooltip = "为 Pawn/PawnState 指定 PlayerIndex", ExposeOnSpawn = "true"))
	int32 Int_PlayerIndex;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Pawn, meta = (Tooltip = "PawnState 管理器"))
	UQ3D_CPPC_PawnState *Ptr_C_PawnState;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Pawn, meta = (Tooltip = "PropertyState 管理器"))
	UQ3D_CPPC_PropertyState *Ptr_C_PropertyState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Q3D_Pawn, meta = (Tooltip = "PropertyState 的初始化数据"))
	UDataTable *Ptr_DT_PropertyInit;

public:
	virtual void Q3D_IF_PlayerIndex_Get_Implementation(int32 &int_player_index) const override;

	virtual void Q3D_IF_PawnState_Get_Implementation(UQ3D_CPPU_PawnState *&ptr_u_pawn_state) const override;

public:
	virtual void Q3D_IF_PropertyState_Get_Implementation(UQ3D_CPPU_PropertyState *&ptr_u_property_state) const override;

	virtual void Q3D_IF_PropertyState_InitDT_Get_Implementation(UDataTable *&ptr_dt_property_init) const override;
};
